#ifndef __TrafficiDentify_H
#define	__TrafficiDentify_H

#include <iostream>
#include <fstream>
#include <cstdlib>
#include <opencv2/opencv.hpp>
#include <opencv2/dnn.hpp>
#include <opencv2/imgproc.hpp>
#include <opencv2/highgui.hpp>
#include <opencv2/core/utils/trace.hpp>

using namespace std;
using namespace cv;

typedef bool (*RotatedRect_ptr)(RotatedRect, RotatedRect);
typedef bool (*RotatedRect_ptr2)(RotatedRect, int);

const int low = 0;
const int high = 1;

const int HSV_H = 0;
const int HSV_S = 1;
const int HSV_V = 2;

const int red = 0;
const int yellow = 1;
const int green = 2;

bool areasortfun(RotatedRect first, RotatedRect second);//排序函数
bool y_sortfun_inv(RotatedRect first, RotatedRect second);//排序函数
Rect assert_boundRect(Rect in, Mat roi);//根据Mat裁剪Rect
vector<RotatedRect> find_area(Mat& img_gray, RotatedRect_ptr sortfun, int areathreshold, int maxarea);//寻找连通域
vector<RotatedRect> find_Lightarea(Mat& img_gray, RotatedRect_ptr sortfun,int thr, int areathreshold);//寻找连通域
void draw_RotatedRect(Mat img, RotatedRect rect, Scalar color);//画线
int findZebarCrossing(Mat inputMat, vector<RotatedRect>& roi);//寻找斑马线
int judgeLights(Mat roi, int color, RotatedRect color_area);//根据处理后的区域内，判断红绿灯
int findSignal(Mat inputMat);//寻找红绿灯可能存在的区域


#endif